<template>
  <div>
    <div class="left_fixed">
      <div class="left_list" :class='clid == index?"selected":""' v-for='(item,index) in list' @click='nav(index)'>{{item.Name}}</div>
    </div>
    <div class="right_fixed">
      <div class="right_list" v-for='(item,index) in list[clid].Datas' @click='ItemList(item.ID,item.ValueIDS)'>
        <img :src="item.Cover" class="right_img">
        <div class="list_text">{{item.Name}}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'classfiy',
  data () {
    return {
      list: [{Datas:[],ID:1,Name:''}],
      clid: 0
    }
  },
  created: function () {
    const that = this
    that.$http('/pinhuoitem/activity/GetRecommendList',{},function(res){
      that.list = res.Data.List
    },'GET')
  },
  methods: {
    ItemList:function(id,ValueIDS){
      this.$router.push({
        path: '/list',
        query: { keyword:'',rid:id,valueIDS:ValueIDS}
      })
    },
    nav:function(idx){
      this.clid = idx
    }
  },

}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  .left_fixed{position: fixed;z-index: 103;width: 25%;left: 0;top: 0;bottom: 50px;border-right:1px solid #ddd;overflow-y: scroll;overflow-x: hidden;}
  .right_fixed{position: fixed;z-index: 103;width: 75%;right: 0;top: 0;bottom: 50px;overflow-y: scroll;overflow-x: hidden;}
  .left_list{font-size: 14px;text-align: center;width: 100%;padding: 25px 0;}
  .selected{font-size: 16px;color: red;}
  .right_list{width: 33.33%;display: inline-block;text-align: center;padding: 10px 0;}
  .right_img{width: 80px;height: 80px;display: inline-block;}
  .list_text{width: 100px;margin-top: 5px;font-size: 14px;height: 24px;line-height: 24px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
</style>
